//package com.wwg.doudian;
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.wwg.util.date.DateCalcUtil;
//import org.apache.commons.lang3.time.DateFormatUtils;
//
//import java.io.UnsupportedEncodingException;
//import java.math.BigInteger;
//import java.security.MessageDigest;
//import java.security.NoSuchAlgorithmException;
//import java.util.Calendar;
//import java.util.Date;
//import java.util.LinkedHashMap;
//import java.util.StringJoiner;
//
//public class Main {
//
//    private static final String APP_SECRET = "3e38351d-9184-43b7-83f7-1542c80c4bb2";
//    private static final String APP_KEY = "6954268087210427934";
//
//    public static void main(String[] args) {
////        String method = "shop.brandList";
////        String method = "order.searchList";
//        String method = "order.list";
//        String paramJson = getParamJson(method);
//        String timestamp = DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss");
//        String apiVersion = "2";
//        String str = APP_SECRET + "app_key" + APP_KEY + "method" + method +
//                "param_json" + paramJson + "timestamp" + timestamp + "v" + apiVersion + APP_SECRET;
//        String res = stringToMD5(str);
//         System.out.println(res);
//    }
//
//    private static String getParamJson(String method) {
//        JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
//        if ("shop.brandList".equals(method)){
//        }else if ("order.searchList".equals(method)){
//            Date date = DateCalcUtil.stringToTime("2021-04-28 00:00:00");
//
//            jsonObject.put("create_time_end", new Date().getTime());
//            jsonObject.put("create_time_start", date.getTime());
//////            状态组合查询，直接输入状态码
////            JSONArray jsonArrays = new JSONArray();
////            JSONObject mainStatus = new JSONObject();
////            mainStatus.put("main_status", "3");
////            JSONObject orderStatus = new JSONObject();
////            orderStatus.put("order_status", "1");
////            jsonArrays.add(mainStatus);
////            jsonArrays.add(orderStatus);
////            jsonObject.put("combine_status", jsonArrays);
////
//            jsonObject.put("page", 0);
//            jsonObject.put("size", 100);
//        }else if("order.list".equals(method)){
//            jsonObject.put("end_time", "2021/04/28 11:00:00");
//            jsonObject.put("order_by", "create_time");
//            jsonObject.put("start_time", "2021/04/28 00:00:00");
//        }
//        String paramJson = jsonObject.toJSONString();
//        return paramJson;
//    }
//
//    public static String stringToMD5(String plainText) {
//        byte[] secretBytes = null;
//        try {
//            secretBytes = MessageDigest.getInstance("md5").digest(
//                    plainText.getBytes("UTF-8"));
//        } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
//            throw new RuntimeException("没有这个md5算法！");
//        }
//        StringBuilder md5code = new StringBuilder(new BigInteger(1, secretBytes).toString(16));
//        while (md5code.length() < 32) {
//            md5code.insert(0, "0");
//        }
//        return md5code.toString();
//    }
//}